History of Selected Object Including Baseline History

So we recently updated our DOORS to the 9.6.1.9 version and while for the most part I have yet to come across any issues, I did get an email from a user trying to use a script from Galactic Solutions that worked previously to the update.

 

I keep getting 1 of 2 errors come up

1. -R-E- DXL: <Line:246> null {0} parameter was passed

2. -R-E- DXL: <Line:255> 64 bit arithmetic is not supported

After testing and narrowing it down I've come across the issue is due to something within this section of code

void HB_populateHistoryListBox( DBE HB_historyListViewDBE, Module m, Object o, Baseline b, int & count ) 
 {
  // For baseline Modules, retrieve Object handle by Absolute Number
     if ( !null b ) 
   {
         ( current ModuleRef__ ) = m
         showDeletedObjects( true )
         o = object( intOf( o."Absolute Number" "" ) )
      }
     if ( !null o ) 
   {
         History h
         for h in o do 
     {
              insert( HB_historyListViewDBE, -count, h.author "", iconNone )//**************

              set( HB_historyListViewDBE, -count, HB_COLUMN_SESSION, h.sessionNo "" )//**************
              set( HB_historyListViewDBE, -count, HB_COLUMN_DATE,    h.date "" )//**************

              string modification = h.type ""
              if ( modification == "modifyObject" ) 
       {
                  modification = modification " attribute '" h.attrName "'"
                  put( HB_oldAttrValues, -count, removeUnlistedRichText( h.oldValue ) )//**************
                  put( HB_newAttrValues, -count, removeUnlistedRichText( h.newValue ) )//**************
               }
              set( HB_historyListViewDBE, -count, HB_COLUMN_MODIFICATION, modification )//**************

              string versionInfo = ""
              if ( !null b ) 
       {
                  versionInfo = "baseline " versionString( moduleVersion( m ) ) " - " ( dateOf b ) ""
               }
              else 
       {
                  versionInfo = "current " version( m ) ""
               }
              set( HB_historyListViewDBE, -count, HB_COLUMN_BASELINE, versionInfo )//**************
      count--
          }
      }
 }

The lines with //******** are the ones causing the issue I believe and the only thing I see in common with them all is the -count

Now I have looked everywhere I could think of and I cant find any reference to anything about -count

 

Does anyone have any ides as to what changed to cause this script to stop working?


MrNiceGuy - Wed Nov 08 18:06:59 EST 2017

Re: History of Selected Object Including Baseline History
MrNiceGuy - Wed Nov 08 18:08:39 EST 2017

Attached is the full script


Attachments

Basline History Galactic Solutions.dxl

Re: History of Selected Object Including Baseline History
O.Wilkop - Thu Nov 09 04:47:25 EST 2017

Hey,

the issue is the "-count" operation, you can fix it by saving the current value of count in a int variable (not a reference) and then changing the sign of that int and using it instead of "-count":

 

void HB_populateHistoryListBox( DBE HB_historyListViewDBE, Module m, Object o, Baseline b, int & count )
{
   // For baseline Modules, retrieve Object handle by Absolute Number
   if ( !null b )
   {
      ( current ModuleRef__ ) = m
      showDeletedObjects( true )
      o = object( intOf( o."Absolute Number" "" ) )
   }
   if ( !null o )
   {
      History h
      for h in o do
      {
         int placeHolder = count;
         placeHolder = -placeHolder;
         insert( HB_historyListViewDBE, placeHolder, h.author "", iconNone )//**************

         set( HB_historyListViewDBE, placeHolder, HB_COLUMN_SESSION, h.sessionNo "" )//**************
         set( HB_historyListViewDBE, placeHolder, HB_COLUMN_DATE,    h.date "" )//**************

         string modification = h.type ""
         if ( modification == "modifyObject" )
         {
            modification = modification " attribute '" h.attrName "'"
            put( HB_oldAttrValues, placeHolder, removeUnlistedRichText( h.oldValue ) )//**************
            put( HB_newAttrValues, placeHolder, removeUnlistedRichText( h.newValue ) )//**************
         }
         set( HB_historyListViewDBE, placeHolder, HB_COLUMN_MODIFICATION, modification )//**************

         string versionInfo = ""
         if ( !null b )
         {
            versionInfo = "baseline " versionString( moduleVersion( m ) ) " - " ( dateOf b ) ""
         }
         else
         {
            versionInfo = "current " version( m ) ""
         }
         set( HB_historyListViewDBE, placeHolder, HB_COLUMN_BASELINE, versionInfo )//**************
         count--
      }
   }
}